const { createLogger, format, transports } = require("winston");

// 创建日志记录器
const logger = createLogger({
    level: "info", // 设定日志级别
    format: format.combine(
        format.timestamp({ format: "YYYY-MM-DD HH:mm:ss" }),
        format.splat(),
        format.align(),
        format.printf((info) => {
            return `[${info.level}] [${info.timestamp}]: ${info.message}`;
        })
    ),
    transports: [new transports.Console()],
});

module.exports = logger;
